package com.vogue.supplymall.order.domain.dao.impl;

import com.vogue.supplymall.order.domain.dao.OrderPayVoucherDao;
import com.vogue.supplymall.order.domain.mapper.OrderPayVoucherMapper;
import com.vogue.supplymall.order.domain.model.OrderPayVoucher;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * The type Order pay voucher dao.
 *
 * @aouthor: zhangliang
 * @date: Create in 2018-04-09
 */
@Repository("orderPayVoucherDao")
public class OrderPayVoucherDaoImpl extends BaseDaoImpl<OrderPayVoucher, Long> implements OrderPayVoucherDao {

    @Resource
    private OrderPayVoucherMapper orderPayVoucherMapper;

    @Override
    public List<OrderPayVoucher> getForOrderId(Long orderId, Long paymentId) {
    	Map<String, Object> map = new HashMap<>();
    	map.put("orderId", orderId);
    	map.put("paymentId", paymentId);
    	return this.selectByWhr0("orderid = #{orderId} AND paymentid = #{paymentId} AND disabledflag = 0", map);
//        return orderPayVoucherMapper.getForOrderId(orderId, paymentId);
    }
}
